<script setup lang="ts">
import HomeBanner from './components/home-banner.vue';
import HomeAdvantage from './components/home-advantage.vue';
import HomeMap from './components/home-map.vue';
import HomeProduct from './components/home-product.vue';
import HomeConcat from './components/home-concat.vue';
import { getCurrentInstance } from 'vue';
import type { ComponentInternalInstance } from 'vue';
const { appContext } = getCurrentInstance() as ComponentInternalInstance;

// 跳转联系我们锚点
const scrollToHomeConcat = () => {
  const homeConcatElement = document.getElementById('home-concat');
  homeConcatElement?.scrollIntoView({ behavior: 'smooth' });
};

// 跳转合作伙伴锚点
appContext.config.globalProperties.$mitt.on('toPartner', () => {
  const homePartnerElement = document.getElementById('home-partner');
  homePartnerElement?.scrollIntoView({ behavior: 'smooth' });
});
</script>

<template>
  <div style="background-color: #eef3f5">
    <HomeBanner @scrollToAnchor="scrollToHomeConcat" />
    <HomeAdvantage />
    <HomeMap />
    <HomeProduct />
    <HomeConcat />
  </div>
</template>

<style scoped></style>
